a. Field of the Invention
This invention relates to an ISO/EIA code conversion method and, more particularly, to an ISO/EIA code conversion method in an NC data input/output unit capable of using an ISO code and an EIA code.
b. Description of the Related Art
In an automatic programming apparatus which automatically creates NC data, the NC data are created in either an ISO code or EIA code system and stored on an external storage medium such as a hard disk. At the time of use, the desired NC data are read out of the external storage medium to perform NC control.
Conventionally, the NC data created by such an automatic programming apparatus are input to or output from the external storage medium through any of the methods (1)-(3) described below.
(1) The code system of the NC data to be input is designated and then only the NC data of the designated code system are input to the external storage medium. At the time of output, the NC data of the input code system are output as is. For example, since an ISO code is an eight-bit code of even parity and an EIA code is an eight-bit code of odd parity, the code system of the input NC data is identified by the parity. The identified code system and a code system designated in advance are compared, only the NC data of the designated code system are stored on the external storage medium, and these data are output in response to a request.
(2) The code system of the NC data to be input are discriminated automatically, only data such as character or numeral data in which both the ISO and EIA codes are used while having the same meaning are converted into an internal code and stored, whereas data (referred to as a characteristic code) in which the ISO and EIA codes are used while having their own meanings, and which include undefined codes, are neglected without being converted into an internal code. At the time of output, the data converted into the internal code are output upon being converted into data of the code system designated at output time.
(3) The characteristic code neglected and not converted in method (2) is registered separately, and if the code system of the data output in (2) and the registered code system are the same, the data are output.
However, with the input/output processing of NC data in method (1), a problem encountered is that the method cannot be used in a case where the input code system and output code system differ. With the input/output processing of NC data in method (2), the characteristic code is neglected without relation to the input code system and output code system. Therefore, all of the data at the time of input cannot be stored in the external storage medium. With the input/output processing of NC data in method (3), the characteristic code must be separately registered and the registration operation is very troublesome.
Accordingly, an object of the present invention is to provide an ISO/EIA code conversion method in which storage is possible irrespective of the code system, input data can be output as is in a case where the input code system and output code system are the same, and an undefined code can be neglected and output in a designated code system in a case where the code systems differ.